﻿using SqlSugar;

namespace Benefactor.Models.DbModels;

[SugarTable("eb_order")]
public class CrmebOrder
{
    [SugarColumn(ColumnName = "id", IsIdentity = true, IsPrimaryKey = true)]
    public int Id { get; set; }

    [SugarColumn(ColumnName = "mer_id", IsNullable = false)]
    public int MerchantId { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "order_no")]
    public string OrderNo { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "plat_order_no")]
    public string PlatformOrderNo { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "status")]
    public short Status { get; set; }

    [SugarColumn(IsNullable = true, ColumnName = "pay_time")]
    public DateTime PayTime { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "uid")]
    public int UserId { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "is_del")]
    public short IsDeleted { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "create_time")]
    public DateTime CreateTime { get; set; }

    [SugarColumn(IsNullable = false, ColumnName = "update_time")]
    public DateTime UpdateTime { get; set; }

    [Navigate(NavigateType.OneToOne, nameof(UserId))]
    public CrmebUser? User { get; set; }

    [SugarColumn(IsIgnore = true)]
    public CrmebOrder? PlatformOrder { get; set; }
}